package com.ecoolex.ying.space.ws;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;
import com.ecoolex.ying.space.entity.*;
import com.ecoolex.ying.space.pojo.*;

import java.util.List;

public interface GoodsService {

    GoodsBrand createBrand(GoodsBrand record, String createUser) throws BizException;

    void updateBrand(GoodsBrand record, String updateUser) throws BizException;

    void deleteBrand(GoodsBrand record, String updateUser) throws BizException;

    GoodsBrand getBrandById(Integer brandId);

    List<GoodsBrand> queryAllBrand();

    Pagination<GoodsBrand> queryBrand(QueryGoodsBrandDTO query, Sorting[] sorts, Page page);

    GoodsClassify createClassify(GoodsClassify record, String createUser) throws BizException;

    void updateClassify(GoodsClassify record, String updateUser) throws BizException;

    void deleteClassify(GoodsClassify record, String updateUser) throws BizException;

    void showClassify(GoodsClassify record, String updateUser) throws BizException;

    void hideClassify(GoodsClassify record, String updateUser) throws BizException;

    GoodsClassify getClassifyById(Integer classifyId);

    List<GoodsClassify> queryAllClassify(Boolean isShow);

    List<GoodsClassify> queryAllParentClassify(Boolean isShow);

    List<GoodsClassify> queryClassifyByParentId(Integer parentClassifyId, Boolean isShow);

    Pagination<GoodsClassify> queryClassify(QueryGoodsClassifyDTO query, Sorting[] sorts, Page page);

    Pagination<GoodsClassify> queryClassifyForH5(Integer parentClassifyId, Page page);

    GoodsLabel createLabel(GoodsLabel record, String createUser) throws BizException;

    void updateLabel(GoodsLabel record, String updateUser) throws BizException;

    void deleteLabel(GoodsLabel record, String updateUser) throws BizException;

    GoodsLabel getLabelById(Integer labelId);

    List<GoodsLabel> queryAllLabel();

    List<GoodsLabel> queryLabel(QueryGoodsLabelDTO query, Integer maxSize);

    Pagination<GoodsLabel> queryLabel(QueryGoodsLabelDTO query, Sorting[] sorts, Page page);

    List<GoodsLabel> queryLabelByGoodsId(Integer goodsId);

    List<GoodsLabel> queryLabelByPickGoodsId(Integer pickGoodsId);

    long countGoodsByClassifyId(Integer classifyId);

    long countGoodsByBrandId(Integer brandId);

    long countGoodsByLabelId(Integer labelId);

    GoodsWithBLOBs createGoods(EditGoodsDTO add, String createUser) throws BizException;

    void updateGoods(Integer goodsId, EditGoodsDTO edit, String updateUser) throws BizException;

    void deleteGoods(GoodsWithBLOBs record, String updateUser) throws BizException;

    GoodsWithBLOBs getGoodsById(Integer goodsId);

    Pagination<GoodsWithBLOBs> queryGoods(QueryGoodsDTO query, Sorting[] sorts, Page page);

    void updateAttachment(Goods goods, EditGoodsAttachmentDTO[] edits, String updateUser) throws BizException;

    List<GoodsAttachment> queryAttachmentByGoodsId(Integer goodsId);

    GoodsAttachment getAttachmentById(Integer attachmentId);

    void updateSpecGroup(Goods goods, List<EditSpecGroupDTO> specGroup, String updateUser) throws BizException;

    List<GoodsSpecGroup> querySpecGroupByGoodsId(Integer goodsId);

    List<GoodsSpec> querySpecByGroupId(Integer groupId);

    GoodsProduct getProductById(Integer productId);

    List<GoodsProduct> queryProductByGoodsId(Integer goodsId);

    void updateProduct(EditGoodsProductDTO edit, String updateUser) throws BizException;

}
